﻿// -----------------------------------------------------------------------
// Copyright (c) Microsoft Corporation.  All rights reserved.
// -----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection.Emit;
using Microsoft.Internal;
using System.Reflection;
using System.Globalization;
using System.Collections;

namespace Microsoft.Internal
{
    // This class serves a single purpose - to represent a delegate overy a generated method. Sadly, one
    // can't create an actual delegate - that can only be created over a runtime method :(
    internal abstract class GeneratedDelegate
    {
        public object Target { get; set; }
        public MethodInfo Method { get; set; }
        public abstract Type DelegateType { get; }
    }

    internal class GeneratedDelegate<TDelegate> : GeneratedDelegate
        where TDelegate : class // actually it should be a delegate, but the compiler wouldn't let us specify that
    {
        public override Type DelegateType
        {
            get
            {
                return typeof(TDelegate);
            }
        }
    }
}
